import java.util.Scanner;
public class CheakerBoard {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		while(input.hasNext()) {
			int count=0;//记录#的个数
			int n=input.nextInt();
			int k=input.nextInt();
			if (n <= 8 && k <= n) {
                input.nextLine(); // 消耗掉前面nextInt后的换行符
                for (int i = 0; i < n; i++) {
                    String str = input.nextLine();
                    for (int j = 0; j < n; j++) {
                        if (str.charAt(j) == '#') {
                            count++;
                        }
                    }
                }
				System.out.println(C(count,k));
				}
			else if(n==-1 && k==-1) {
				break;
			}
			else
				System.out.println("输入错误！");
		}
	}
	public static int A(int a,int b) {
		int result=1;
		for(int i=b;i>0;i--) {
			result*=a;
			a--;
		}
		return result; 
	}
	public static int C(int a,int b) {
		int denominator=A(b,b);
		int numerator=A(a,b);
		return numerator/denominator;
	}
}